import tkinter as tk

import pyautogui


def update_image():
    state = "normal" if pyautogui.pixel(230, 123) == (232, 255, 255) else "hidden"
    # state = "normal" if pyautogui.pixel(550, 400) == (232, 255, 255) else "hidden"
    # state = "normal" if pyautogui.pixel(306, 165) == (232, 255, 255) else "hidden"
    canvas.itemconfig(image_on_canvas, state=state)
    root.after(500, update_image)


root = tk.Tk()
root.overrideredirect(True)
root.attributes("-transparentcolor", "black", "-topmost", True)

canvas = tk.Canvas(root, bg="black", highlightthickness=0)
canvas.pack()

tk_img = tk.PhotoImage(file="BoostBlinker.png")

window_x = root.winfo_screenwidth() // 2 + 100
window_y = root.winfo_screenheight() // 2 + 50
root.geometry(f"+{window_x}+{window_y}")

image_on_canvas = canvas.create_image(0, 0, image=tk_img, anchor="nw", state="normal")

update_image()

root.mainloop()
